package com.xiu.json;

import java.util.Map;
import java.util.Set;

/**
 * @Author: tjc
 * @description
 * @Date Created in 20:45 2022-04-02
 */
public class JSONObject {
    Map<String, Object> map;

    public JSONObject(Map<String, Object> map) {
        this.map = map;
    }

    public Object get(String key) {
        return map.get(key);
    }

    public JSONObject getJSONObject(String key) {
        return new JSONObject((Map<String, Object>) map.get(key));
    }

    public JSONArray getJSONArray(String key) {
        return new JSONArray((Object[]) map.get(key));
    }

    public Set<Map.Entry<String, Object>> kvSet() {
        return map.entrySet();
    }

}
